import { ref } from "vue";

export default function useCounter(value = 0) {
  const counter = ref(value);
  const increment = () => counter.value++;
  const decrement = () => counter.value--;

  return {
    counter,
    increment,
    decrement,
  };
}
